package com.yxhl.km.module.utils;

import android.content.Context;
import android.net.Uri;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;
import com.yxhl.km.R;

import java.io.File;
import java.net.URL;

/**
 * Created by zhangyanan on 2017/11/6.
 */

public class PicassoUtil {

    public static void LoadPicasso(Context context, String url, ImageView imageView) {
        Picasso.with(context).load(url)
                .placeholder(R.mipmap.ic_launcher)
                .error(R.mipmap.ic_launcher)
                .into(imageView);
    }

    public static void LoadUriPicasso(Context context, Uri url, ImageView imageView) {
        Picasso.with(context).load(url).into(imageView);

    }

    public static void LoadFilePicasso(Context context, File file, ImageView imageView) {
        Picasso.with(context).load(file).into(imageView);

    }
}
